import { createApp } from 'vue';
import * as ElIcons from '@element-plus/icons-vue';
import App from './App.vue';
import 'element-plus/theme-chalk/index.css';
import router from './route';
import store from './store';

const app = createApp(App);

// 引入并注册Pinia对象
app.use(store);

// 引入并注册路由对象
app.use(router);

// 全局注册element-plus icon图标组件
Object.keys(ElIcons).forEach((key) => {
  app.component(`Eli${key}`, ElIcons[key as keyof typeof ElIcons]);
});
app.mount('#app');
